package com.zdlee.netty.server12.util;


import com.zdlee.netty.server12.attribute.Attributes;
import io.netty.channel.Channel;
import io.netty.util.Attribute;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-11-29 14:39
 */
public class LoginUtil {

    public static void markAsLogin(Channel channel){
        channel.attr(Attributes.LOGIN).set(true);
    }

    public static boolean hasLogin(Channel channel){
        Attribute<Boolean> loginAttr=channel.attr(Attributes.LOGIN);
        return loginAttr.get()!=null;
    }
}
